﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Web.Routing;
using System.Web;
using System.IO;
using ASPItalia.ModelVirtualCasting.Web.Tests.Utils;

namespace ASPItalia.ModelVirtualCasting.Web.Tests.Routes
{
    [TestClass]
    public class DefaultRouteTest : RouteTestBase
    {
        [TestMethod]
        public void DefaultRoute_Empty()
        {
            RouteData routeData = this.GetRouteData("~/");

            // verifica su {controller}, {Action}, {id}
            RouteTestHelper.AssertRoute(routeData, "Home", "Index", string.Empty);
        }

        [TestMethod]
        public void DefaultRoute_Home_News_Id()
        {
            RouteData routeData = this.GetRouteData("~/Home/News/5");

            // verifica su {controller}, {Action}, {id}
            RouteTestHelper.AssertRoute(routeData, "Home", "News", "5");
        }

        [TestMethod]
        public void DefaultRoute_NotMapped()
        {
            RouteData routeData = this.GetRouteData("~/Home/News/5/a/b");

            // verifica che non sia mappato
            RouteTestHelper.AssertNotMapped(routeData);
        }

        [TestMethod]
        public void WebApi_Controller_Ignored()
        {
            RouteData routeData = this.GetRouteData("~/webapi/test/test");

            // verifica che non sia mappato
            RouteTestHelper.AssertNotMapped(routeData);
        }
        
    }
}
